package com.pan.utils;

public class RandomCode {


    public static char[] getChars(int len){
        //48 0-9 0-9 +48   65 A-Z 10-35 +55  97 a-z 36-61 +61
        if (len==0) return null;
        char[] chars = new char[len];
        for (int i = 0; i < len; i++) {
            int r = (int) (Math.random() * 62);
            if (r<10) {
                r+=48;
                if (r==48||r==49){
                    r+=2;
                }
            }else if (r<36 && r>=10) {
                r += 55;
                if (r==73||r==79) {
                    r+=1;
                }
            } else if (r>=36) {
                r+=61;
                if (r==111||r==108){
                    r+=1;
                }
            }
            chars[i] = (char) r;
        }
        return chars;
    }


}
